﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Text;
using System.Collections.Generic;

using FrameWork;
using FrameWork.Components;
using FrameWork.WebControls;


namespace FrameWork.web.Module.ITMS.FrontPage
{
    public partial class MyNewsItem : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string strA_ID = Request.QueryString["id"].ToString();
                if (strA_ID != "")
                {
                    QueryParam qp = new QueryParam();
                    qp.Where = " Where A_ID = " + strA_ID;
                    qp.PageIndex = 1;
                    qp.PageSize = 10;
                    int RecordCount = 0;
                    ArrayList lst = BusinessFacade.FRAMEWORK_ARTICLEList(qp, out RecordCount);
                    if (lst.Count > 0)
                    {
                        FRAMEWORK_ARTICLEEntity NewsItem = lst[0] as FRAMEWORK_ARTICLEEntity;
                        this.labTitle.Text = NewsItem.A_Title;
                        this.tdNewsMessage.InnerHtml = NewsItem.A_Txt;
                        this.labDateTime.Text = NewsItem.A_DateTime.ToShortDateString();
                        if (NewsItem.A_Photo != "")
                        {
                            this.imgPhoto.ImageUrl = Common.UpLoadDir + "NewsFile/" + NewsItem.A_Photo;

                        }
                        else
                        {
                            this.imgPhoto.Visible = false;
                        }
                    }
                  
                }
            }
        }
    }
}
